package info.ferrarimarco.itEbooksDownloader.controller;

import java.io.IOException;
import java.util.List;

public class BookNameDownloaderTask implements Runnable {

	private int bookIndexStart;
	private int bookIndexEnd;
	private final String tagStart;
	private final String tagEnd;
	
	private List<String> result;

	public BookNameDownloaderTask(int bookIndexStart, int bookIndexEnd, String tagStart, String tagEnd) {
		super();
		this.bookIndexStart = bookIndexStart;
		this.bookIndexEnd = bookIndexEnd;
		this.tagStart = tagStart;
		this.tagEnd = tagEnd;
	}
	
	@Override
	public void run() {
		
		try {
			setResult(BookNameDownloader.downloadNames(bookIndexStart, bookIndexEnd, tagStart, tagEnd));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public List<String> getResult() {
		return result;
	}

	public void setResult(List<String> result) {
		this.result = result;
	}





}
